package org.demo.patten.visitor;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhuj
 * @date 2025/3/29
 * @apiNote
 */
public class Folder implements FileSystemElement {
    private String name;
    private List<FileSystemElement> children = new ArrayList<>();
    public Folder(String name) { this.name = name; }
    public void add(FileSystemElement element) {
        children.add(element);
    }
    public List<FileSystemElement> getChildren() { return children; }
    public String getName() { return name; }
    public void accept(Visitor visitor) {
        visitor.visit(this);
    }
}
